
<template>
  <div class="zjylistpage-list-item zjylistpage-list-item-width" v-for="(item2,index) in props.itemData.arr"
       v-show="props.itemData.viewShow==1">
    <div class="zjylistpage-list-item-data">
      <div class="zjylistpage-list-item-div1  zjylistpage-list-item-div-cloum1 zjylistpage-list-item-div1"
          :class="jcbackground(item2)"
        @click="itemClick(item2,props.cjRegion+1)">
        <img class="zjylistpage-list-item-div-img" :src="item2.viewShow==0?icon1:icon2"  v-show="item2.cj==3?false:true">
        <div class="zjylistpage-list-item-div-div">
          {{ item2.vd.t1 }}
        </div>
      </div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)"
           @click="qiyeshuClick(item,'qiye','企业销售情况')"
           style="color: #16CE8A;">{{ item2.vd.t2 }}</div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" @click="props.qiyeshuClick(item2,'pz','品种销售情况')"
           style="color: #16CE8A;">{{ item2.vd.t3 }}</div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" v-html="item2.vd.t4" @click="props.qiyeshuClick(item2,'diaoyunliang','调运量情况')"
           style="color: #16CE8A;"></div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" v-html="item2.vd.t5"  @click="props.qiyeshuClick(item2,'beianzhexinxi','备案者信息')"
           style="color: #16CE8A;"></div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" v-html="item2.vd.t6" @click="props.qiyeshuClick(item2,'mendiandaohuoliang','门店到货清况')"
           style="color: #16CE8A;"></div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" v-html="item2.vd.t7" @click="props.qiyeshuClick(item2,'xiaoshouliang','销售清况')"
           style="color: #16CE8A;"></div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" v-html="item2.vd.t8" @click="props.qiyeshuClick(item2,'zhongzhinonghushu','种植农户列表')"
           style="color: #16CE8A;"></div>
      <div class="zjylistpage-list-item-div" :class="jcbackground(item2)" v-html="item2.vd.t9"></div>
    </div>
    <div class="zjylistpage-list-line"></div>
    <Adapter :itemData="item2" :cjRegion="cjRegion+1" :qiyeshuClick="qiyeshuClick"/>
  </div>
</template>
<script setup>
import {reactive, onMounted, inject, ref, markRaw, provide} from "vue";
import uiUtil from "@/util/UiUtil.js";
import { defineProps, withDefaults } from 'vue';
import Adapter from "@/components/ZJYListPage/ZjyListAdapter.vue"
import icon1 from "@/assets/img/jiantou1.webp"
import icon2 from "@/assets/img/jiantou2.png"

const props = defineProps({
  itemData: {
    type: Object,
    default: {
      arr: []
    }
  },
  itemClick:Function,
  cjRegion:Number,
  qiyeshuClick:Function
})

onMounted(()=>{
  console.log('cjRegion=',props.cjRegion)
  // debugger
  if (uiUtil.isNull(props.itemData.arr)){
    props.itemData.arr = []
  }
})

const jcbackground=(item) => {
  // console.log('props.itemData.cj 1=',item)
  // console.log('props.itemData.cj 2=',props.itemData)
  if (item.cj==2){
    return 'cj2_background'
  }else if (item.cj==3){
    return 'cj3_background'
  }
}
</script>

<style scoped lang="less">
.cj2_background{
  background-color: #E7E7E7;
  box-sizing: border-box;
  padding-left: 10px;
}
.cj3_background{
  background-color: #A8DBD7;
  box-sizing: border-box;
  padding-left: 25px;
}
</style>
